﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using _4T.Data;
using _4T.DAL;

namespace _4T.BLL
{
    public class InfoSupplierInfoBLL
    {
        private InfoSupplierInfoDAL supplierDAL;
        public InfoSupplierInfoDAL SupplierDAL
        {
            get
            {
                if (supplierDAL == null)
                {
                    supplierDAL = new InfoSupplierInfoDAL();
                }
                return supplierDAL;
            }
        }

        public InfoSupplierInfo GetInfoSupplierInfo(string profileCode)
        {
            CMS_ProfileInfo info = new ProfileInfoDAL().GetLastProfileInfoByProfileCode(profileCode);
            if (info != null)
            {
                return SupplierDAL.GetInfoSupplierInfo(info.ProfileInfoCode);
            }
            return null;
        }

        public InfoSupplierInfo GetInfoSupplierInfoByProfileInfoCode(string profileInfoCode)
        {
            return SupplierDAL.GetInfoSupplierInfo(profileInfoCode);
        }
    }
}